<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="view_param_margin_sales_report" model="ir.ui.view">
			<field name="name">view.param.margin.sales.report</field>
			<field name="model">param.margin.sales.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Gross Margin Report by Invoice Number">
					<separator string="Gross Margin Report by Invoice Number" colspan="4"/>
					<label colspan="4" nolabel="1" string="This menu prints Gross Margin Report by Invoice Number"/>
					<newline/>
					<notebook colspan="4">
						<page string="Invoice No">
							<field name="invoice_selection" colspan="4"/>
							<field name="invoice_default_from" attrs="{'invisible': [('invoice_selection','!=','def')], 'required': [('invoice_selection','=','def')]}"/>
							<field name="invoice_default_to" attrs="{'invisible': [('invoice_selection','!=','def')], 'required': [('invoice_selection','=','def')]}"/>
							<field name="invoice_input_from"
								attrs="{'invisible': [('invoice_selection','!=','input')], 'required': [('invoice_selection','=','input')]}"/>
							<field name="invoice_input_to"
								attrs="{'invisible': [('invoice_selection','!=','input')], 'required': [('invoice_selection','=','input')]}"/>
							<field name="invoice_ids"
								attrs="{'invisible': [('invoice_selection','!=','selection')], 'required': [('invoice_selection','=','selection')]}" nolabel="1" colspan="4">
								<tree>
									<field name="name"/>
								</tree>
							</field>
						</page>
						<page string="Inv Date">
							<field name="date_selection" colspan="4"/>
							<field name="date_from" attrs="{'invisible': [('date_selection','!=','date_sel')], 'required': [('date_selection','=','date_sel')]}"/>
							<field name="date_to" attrs="{'invisible': [('date_selection','!=','date_sel')], 'required': [('date_selection','=','date_sel')]}"/>
						</page>
					</notebook>
					<group col="2" colspan="4">
						<button icon='gtk-cancel' special="cancel" string="Cancel"/>
						<button icon="gtk-print" name="check_report" string="Print as CSV" type="object" colspan="1" default_focus="1" />
						<!--button name="create_vat" string="Print as PDF" colspan="2" type="object" icon="gtk-ok"/-->
					</group>
				</form>
			</field>
		</record>

		<record id="margin_sales_csv_view" model="ir.ui.view">
			<field name="name">Gross Margin Report by Invoice Number</field>
			<field name="model">param.margin.sales.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Report Options">
					<field name="data" filename="filename" colspan="4" readonly="1"/>
					<field name="filename" invisible="1"/>
					<separator colspan="4"/>
					<group col="4" colspan="4">
						<button icon="gtk-cancel" special="cancel" string="Cancel" colspan="2"/>
					</group>
				</form>
			</field>
		</record>

		<record id="action_param_margin_sales_report" model="ir.actions.act_window">
			<field name="name">Gross Margin Report by Invoice Number</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">param.margin.sales.report</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_param_margin_sales_report"/>
			<field name="target">new</field>
			<field name="help">This menu print Gross Margin Report by Invoice Number.</field>
		</record>

		<menuitem
			id="menu_param_margin_sales_report"
			name="Gross Margin Report by Invoice Number"
			action="action_param_margin_sales_report"
			parent="menu_custom_sale" sequence="7"/>
	</data>
</openerp>
